/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package aqu.persistencia.entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author angelquingaluisa
 */
@Entity
@Table(name = "con_empresa")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ConEmpresa.findAll", query = "SELECT c FROM ConEmpresa c"),
    @NamedQuery(name = "ConEmpresa.findByConCodigoEmp", query = "SELECT c FROM ConEmpresa c WHERE c.conCodigoEmp = :conCodigoEmp"),
    @NamedQuery(name = "ConEmpresa.findByConNombreEmp", query = "SELECT c FROM ConEmpresa c WHERE c.conNombreEmp = :conNombreEmp")})
public class ConEmpresa implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @NotNull
    @Size(min = 1, max = 10)
    @Column(name = "CON_CODIGO_EMP")
    private String conCodigoEmp;
    @Size(max = 30)
    @Column(name = "CON_NOMBRE_EMP")
    private String conNombreEmp;
    
    public ConEmpresa() {
    }

    public ConEmpresa(String conCodigoEmp) {
        this.conCodigoEmp = conCodigoEmp;
    }

    public String getConCodigoEmp() {
        return conCodigoEmp;
    }

    public void setConCodigoEmp(String conCodigoEmp) {
        this.conCodigoEmp = conCodigoEmp;
    }

    public String getConNombreEmp() {
        return conNombreEmp;
    }

    public void setConNombreEmp(String conNombreEmp) {
        this.conNombreEmp = conNombreEmp;
    }

    

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (conCodigoEmp != null ? conCodigoEmp.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ConEmpresa)) {
            return false;
        }
        ConEmpresa other = (ConEmpresa) object;
        if ((this.conCodigoEmp == null && other.conCodigoEmp != null) || (this.conCodigoEmp != null && !this.conCodigoEmp.equals(other.conCodigoEmp))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "clases.ConEmpresa[ conCodigoEmp=" + conCodigoEmp + " ]";
    }
    
}
